#ifndef EXIT_H
#define EXIT_H

#include "crossbit/common.h"
#include "crossbit/VInst.h"

namespace crossbit
{
		struct ExitReason {
				enum {
						HEAD = 0,
						ENDOFBLOCK,
						BRANCHTAKEN,
						SYSCALLEXIT,
				};
		};
		struct LinkType {
				enum {
						DIRECT = 0 ,
						INDIRECT,
						NOLINK,
				};
		};	

		typedef struct {
				XTInt32		why;
				XTMemAddr	next;		// _source_ address of next _source_ instruction
				XTInt32		exitOffset;	// offset from the beginning of the tblock
				VInst		*inst;		// the VInst triggering the exit, NULL if
				// non-relavant to any VInst
				//added by zhengjuyu
				XTInt32 linked;
				XTInt8 *linkCode;
				XTMemAddr dest;		//direct trace link to
				//added by suntingtao
				XTInt32  link_type;
		} Exit;
}

#endif
